# -*- coding: utf-8 -*-
from liberHook.BaseHook import BaseHook
from liberLibs.dccLibs import Maya


class Hook(BaseHook):
    def __init__(self, library, directory, ext, start, end):
        BaseHook.__init__(self, library, directory, ext, start, end)

    def execute(self):
        if not Maya.load_plugin("gpuCache.mll"):
            self.append_error("Load gpuCache.mll failed.")
            return
        sel = Maya.selected()
        Maya.export_gpu_cache(sel, self.location, self.name, self.start, self.end, False)